<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        //			注意注意请注意*****
//			x不是yield "张三"的返回值，他是next()调用  恢复当前yiled()执行传入的实参
        function* add(){
            console.log(1111);
           let x = yield "张三";
            console.log(x);
           let y = yield "啊哈哈";
           console.log(x+y);

        }
        let it = add();
        console.log(it.next());
        console.log(it.next(10));
        console.log(it.next(20));
    </script>
</body>
</html>